<table>
  <tr>
    <th>Codice</th>
    <th>Cliente</th>
    <th>Scadenza</th>
    <th>Descrizione</th>
    <th colspan="3">Comandi</th>
  </tr>

<% for contract in @contracts %>
  <tr class="<%= cycle("even", "odd") %>">
    <td><%= contract.code %></td>
    <td><%= Client.find(contract.client_id).name_or_society %></td>
    <td><%= contract.expiration.strftime("%d %B %Y") %></td>
    <td><%= truncate(contract.notes, 20) %></td>
    <td><%= link_to image_tag("info.png", :alt => "show"), contract %></td>
    <td><%= link_to image_tag("edit.png", :alt => "edit"), edit_contract_path(contract) %></td>
    <td><%= link_to image_tag("delete.png", :alt => "delete"), contract, :confirm => 'Sei sicuro?', :method => :delete %></td>
  </tr>
<% end %>
</table>
<%= will_paginate @contracts, option = {:inner_window => 2, :outer_window => 3} %>